import java.util.ArrayList;
import java.util.List;

public class Test {


    public static void main(String[] args) {
        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(1);
        arrayList.add(2);
        arrayList.add(3);
        arrayList.add(4);
        arrayList.add(5);
        System.out.println(arrayList);

        List<Integer> list = arrayList.subList(1,4);// [1,4)
        System.out.println(list);
        System.out.println("====================");

        list.set(0,22);
        System.out.println(list);
        System.out.println(arrayList);
    }
}
